package truef.service.house.service;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import edu.zut.cs.software.base.service.GenericGenerator;
import truef.house.domain.SAdress;
import truef.house.domain.SWarehouse;


public class saaswEntityGenerator extends GenericGenerator{
	@Autowired
	SWarehouseManager SWarehouseManager;
	
	@Autowired
	SAdressManager SAdressManager;
	@Test
    public void gen_SAdress() {
        for (int i = 0; i < 2; i++) {
        	SAdress g = new SAdress();
            g.setName("SAdress_" + i);
            this.SAdressManager.save(g);
            for (int j = 0; j < 2; j++) {
            	SAdress SAdress = new SAdress();
            	SAdress.setName("SAdress_" + i + "_" + j);
            	SAdress.setParent(g);
                g = this.SAdressManager.save(SAdress);
                this.gen_swarehouse(g);
            }
        }
    }
	
	public void gen_swarehouse(SAdress g) {
		for (int i = 0; i < 2; i++) {
            SWarehouse u = new SWarehouse();
            u.setname("SWarehousename_" + i);
            this.SWarehouseManager.save(u);
        }
	}
}
